package wuaipojie

import (
	"context"
	"gitee.com/kaylee595/gkaylee/kerr"
	"strings"
)

func (c *Client) WafZWVerify(ctx context.Context, payload string) error {
	url := "https://www.52pojie.cn/waf_zw_verify"
	resp := c.httpClient.Post(url).SetContentType("text/plain;charset=UTF-8").SetBodyString(payload).Do(ctx)
	if resp.Err != nil {
		return kerr.WrapTraceStack(resp.Err)
	}
	ret := resp.String()
	if !strings.EqualFold(ret, "ok") {
		return kerr.WrapTraceStack(ErrWAFZWVerify(ret))
	}
	return nil
}
